package com.singzi.leetcode.N100;

public class T0082 {
}
class Solution0082 {
    public ListNode deleteDuplicates(ListNode head) {
        ListNode ans = new ListNode(0);
        ans.next = head;
        ListNode p = ans;
        ListNode t = head;
        boolean flag = false;
        while(t != null){
            ListNode tmp = t.next;
            while(tmp != null && tmp.val == t.val){
                tmp = tmp.next;
                flag = true;
            }
            t = tmp;
            p = t;
            flag = false;
            t = t.next;
        }
        return ans.next;

    }
}